import {
	getPayInfo
} from '@/api/index.js'

/**
 * 显示消息提示框
 * @param content 提示的标题
 */
export function toast(content) {
	uni.showToast({
		icon: 'none',
		title: content
	})
}

/**
 * 显示模态弹窗
 * @param content 提示的标题
 */
export function showConfirm(content) {
	return new Promise((resolve, reject) => {
		uni.showModal({
			title: '提示',
			content: content,
			cancelText: '取消',
			confirmText: '确定',
			success: function(res) {
				resolve(res)
			}
		})
	})
}

/**
 * 参数处理
 * @param params 参数
 */
export function tansParams(params) {
	let result = ''
	for (const propName of Object.keys(params)) {
		const value = params[propName]
		var part = encodeURIComponent(propName) + "="
		if (value !== null && value !== "" && typeof(value) !== "undefined") {
			if (typeof value === 'object') {
				for (const key of Object.keys(value)) {
					if (value[key] !== null && value[key] !== "" && typeof(value[key]) !== 'undefined') {
						let params = propName + '[' + key + ']'
						var subPart = encodeURIComponent(params) + "="
						result += subPart + encodeURIComponent(value[key]) + "&"
					}
				}
			} else {
				result += part + encodeURIComponent(value) + "&"
			}
		}
	}
	return result
}

export const path = ['', 'bdp', 'bd', 'com', 'mar', 'jud', 'imm', 'edu', 'mili']

export function isWeiXin() {
	const chk = new RegExp("MicroMessenger", "i");
	const ua = navigator.userAgent.toLowerCase();
	return chk.test(ua);
}

export function FP() {
	window.open('http://www.funishe.com/chat.html')
}

export function FX() {
	this.$copyText(window.location.href).then((e) => {
		this.$modal.msgSuccess('报告链接已复制')
	}, (e) => {
		alert('报告链接复制失败，请手动复制网页链接')
	})
}

export function zeroTwo(x) {
	x = parseFloat(x)
	var f = Math.round(x * 100) / 100
	var s = f.toString()
	var rs = s.indexOf(".")
	if (rs < 0) {
		rs = s.length
		s += "."
	}
	while (s.length <= rs + 2) {
		s += "0"
	}
	return s
}

export let searchData = [
    [
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ]
    ],
    [
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ]
    ],
    [
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ]
    ],
    [
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ]
    ],
    [
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0]
        ],
        [
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0],
            [0, 0]
        ]
    ]
]

export let searchNameData = [
    [
        {
            left: '法院失信人',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '法院被执行人',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行(含信用卡)一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行(含信用卡)中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行(含信用卡)高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行(含信用卡)高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行(含信用卡)拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌小贷中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌小贷高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌小贷资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌小贷拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌融资租赁高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌融资租赁资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌融资租赁拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌汽车金融一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌汽车金融中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌汽车金融高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌汽车金融资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
    ],
    [
        {
            left: '银行-(含信用卡)一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行-(含信用卡)中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行-(含信用卡)高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行-(含信用卡)资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '银行-(含信用卡)拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌网络小贷拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌小贷中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌小贷高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌小贷资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌小贷拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌消费金融拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌融资租赁高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌融资租赁资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌融资租赁拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌汽车金融一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌汽车金融中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌汽车金融高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-持牌汽车金融资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)一般风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)中风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)高风险',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)资信不佳',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        },
        {
            left: '非银-(信保、信托等)拒绝',
            right: '未命中',
            smallLeft: '0',
            smallRight: '无',
            check: false
        }
    ]
]
